package com.usian.ai.controller;

import com.usian.ai.common.Result;
import com.usian.ai.common.vo.InterviewerReqVo;
import com.usian.ai.common.vo.PageVo;
import com.usian.ai.pojo.Interviewer;
import com.usian.ai.service.InterviewerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 12 09 09 55
 **/

@RestController
@RequestMapping("interviewer")
@Slf4j
@CrossOrigin
public class InterviewerController {

    @Autowired
    InterviewerService interviewerService;

    @PostMapping("addInterviewer")
    public Result addInterviewer(@RequestBody @Validated InterviewerReqVo interviewerReqVo)
    {
        return interviewerService.addInterviewer(interviewerReqVo);
    }


    @PostMapping("listInterviewers")
    public Result listInterviewers(@RequestBody  PageVo pageVo)
    {
        return interviewerService.listInterviewers(pageVo);
    }


    @GetMapping("listInterviewers")
    public Result listInterviewers()
    {
        List<Interviewer> list = interviewerService.list();
        return Result.ok(list);
    }



}
